/*  dreic -- a compiler for Drei
 *
 *  $Id: Symbol.scala 3228 2006-12-07 02:05:31Z dubochet $
 */

package dreic

/**
 * This class provides a representation for symbol table entries.
 */
sealed abstract class Symbol {

  /** The postion in the source file where the symbol was defined */
  def pos: Int

  /** Name of the symbol */
  def name: Name

  // Establish the link between the name and the symbol
//  name.sym = this
  
}

case class ClassSymbol(name: Name, parents: List[Name], fields: FieldScope, methods: MethodScope, pos: Int) extends Symbol{
}

case class FieldSymbol(name: Name, t: Type, pos: Int, offset: Int) extends Symbol

case class MethodSymbol(name: Name, argTypes: List[Type], retType: Type, variables: VarScope, pos: Int) extends Symbol

case class VarSymbol(name:Name, t: Type, pos: Int, offset: Int) extends Symbol

/**
* Classes for types
*/
abstract class Type;

case class IClassType(clazz: ClassSymbol) extends Type;

case object IIntType extends Type;

case object INoType extends Type;

case object IBadType extends Type;